package com.renchunlin.taobaounion.ui.fragment;

import android.os.Bundle;
import android.view.View;

import com.renchunlin.taobaounion.R;
import com.renchunlin.taobaounion.base.BaseFragment;
import com.renchunlin.taobaounion.model.domain.Categories;
import com.renchunlin.taobaounion.utils.LogUtils;

import static com.renchunlin.taobaounion.utils.Constants.KEY_HOME_PAGER_MATERIAL_ID;
import static com.renchunlin.taobaounion.utils.Constants.KEY_HOME_PAGER_TITLE;

public class HomePagerFragment extends BaseFragment {

    public static HomePagerFragment newInstance(Categories.DataBean categories) {
        HomePagerFragment homePagerFragment = new HomePagerFragment();
        Bundle bundle = new Bundle();
        bundle.putString(KEY_HOME_PAGER_TITLE, categories.getTitle());
        bundle.putInt(KEY_HOME_PAGER_MATERIAL_ID, categories.getId());
        homePagerFragment.setArguments(bundle);
        return homePagerFragment;
    }

    @Override
    protected int getRootViewResId() {
        return R.layout.fragment_home_pager;
    }

    @Override
    protected void initView(View rootView) {
        setUpState(State.SUCCESS);
    }

    @Override
    protected void loadData() {
        Bundle argument = getArguments();
        String title = argument.getString(KEY_HOME_PAGER_TITLE);
        int materialid = argument.getInt(KEY_HOME_PAGER_MATERIAL_ID);
        //加载数据
        LogUtils.d(HomePagerFragment.class, "TITLE" + title + ",materialid" + materialid);
    }
}
